package com.nbsaas.boot.customer.rest.resource;

import com.nbsaas.boot.customer.api.apis.CustomerLabelCatalogApi;
import com.nbsaas.boot.customer.data.entity.CustomerLabelCatalog;
import com.nbsaas.boot.customer.api.domain.request.CustomerLabelCatalogRequest;
import com.nbsaas.boot.customer.api.domain.response.CustomerLabelCatalogResponse;
import com.nbsaas.boot.customer.api.domain.simple.CustomerLabelCatalogSimple;
import com.nbsaas.boot.customer.rest.convert.CustomerLabelCatalogSimpleConvert;
import com.nbsaas.boot.customer.rest.convert.CustomerLabelCatalogEntityConvert;
import com.nbsaas.boot.customer.rest.convert.CustomerLabelCatalogResponseConvert;
import com.nbsaas.boot.customer.data.repository.CustomerLabelCatalogRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   标签分组-业务接口实现
*/
@Transactional
@Service
public class CustomerLabelCatalogResource extends BaseResource<CustomerLabelCatalog,CustomerLabelCatalogResponse, CustomerLabelCatalogSimple, CustomerLabelCatalogRequest>  implements CustomerLabelCatalogApi {

    @Resource
    private CustomerLabelCatalogRepository customerLabelCatalogRepository;

    @Override
    public JpaRepositoryImplementation<CustomerLabelCatalog, Serializable> getJpaRepository() {
        return customerLabelCatalogRepository;
    }

    @Override
    public Function<CustomerLabelCatalog, CustomerLabelCatalogSimple> getConvertSimple() {
        return new CustomerLabelCatalogSimpleConvert();
    }

    @Override
    public Function<CustomerLabelCatalogRequest, CustomerLabelCatalog> getConvertForm() {
        return new CustomerLabelCatalogEntityConvert();
    }

    @Override
    public Function<CustomerLabelCatalog, CustomerLabelCatalogResponse> getConvertResponse() {
        return new CustomerLabelCatalogResponseConvert();
    }




}


